<template>
    <div class="info-panel">
      <div v-if="title" class="panel-title">{{ title }}</div>
      <div class="panel-content">
        <slot></slot> <!-- Where the chart or content goes -->
      </div>
    </div>
</template>

<script setup lang="ts">
    defineProps<{
        title?: string;
    }>();
</script>
  
<style lang="less" scoped>
  @import '@/styles/variables.less';
  
  .info-panel {
    background-color: @panel-bg;
    border: 1px solid @panel-border-color;
    border-radius: 5px;
    padding: @panel-padding;
    position: relative;
    box-shadow: 0 0 15px rgba(0, 174, 255, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%; // Allow panel to fill grid cell height
  }
  
  .panel-title {
    font-size: 16px;
    position: relative;
    padding-left: 15px;
    margin-bottom: 15px;
    color: #0ce0ff; // Specific title color from original
    flex-shrink: 0;
  
    &::before {
      content: "";
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 5px;
      height: 20px;
      background: linear-gradient(to bottom, @primary-color, @secondary-color);
    }
  }
  
  .panel-content {
    flex-grow: 1; // Allow content (like charts) to fill remaining space
    position: relative; // Needed for absolute positioning within content area if required
    display: flex; // Ensure chart containers inside can grow
    flex-direction: column; // Stack content vertically if multiple elements
  }
  </style>